package com.iqiyi.pps.epg.api.server.iservice;

import com.alibaba.fastjson.JSONObject;
import com.iqiyi.mams.hedvig.http.mediatype.ExtendedMediaType;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;

@Path("/")
@Produces({ExtendedMediaType.APPLICATION_X_THRIFT})
public interface BasementApiService {
    @GET
    @Path("/test/msg")
    @Produces(MediaType.APPLICATION_JSON)
    public String testMsg();

    @POST
    @Path("/suggest/streamName")
    @Produces(MediaType.APPLICATION_JSON)
    public String getStreamNameSuggest(@FormParam("fatherId") long fatherId,
                                       @FormParam("streamName") String streamName);

    @POST
    @Path("/ts/create")
    @Produces(MediaType.APPLICATION_JSON)
    public String createTs(@FormParam("fatherId") String fatherId,
                           @FormParam("streamName") String streamName,
                           @FormParam("streamIp") String streamIp);

    // 获取LiveStream
    @POST
    @Path("/liveStream/getList")
    @Produces(MediaType.APPLICATION_JSON)
    public String getLiveStream(@FormParam("fatherId") String fatherId,
                                @FormParam("streamName") String streamName,
                                @FormParam("formatType") String formatType);

    // 通知 LiveStream 切片服务状态更新
    @POST
    @Path("/liveStream/notifyChange")
    @Produces(MediaType.APPLICATION_JSON)
    public String notifyChange(@FormParam("user") String user,
                                @FormParam("streamName") String streamName,
                                @FormParam("stream_server") String streamServer,
                                @FormParam("stream_url") String streamUrl);

    // 记录直播流监控日志
    @POST
    @Path("/liveStream/monitor")
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public String streamMonitor(JSONObject jsonObject);


    //频道流管理FLV
    @POST
    @Path("/flv/create")
    @Produces(MediaType.APPLICATION_JSON)
    public String createFlv(@FormParam("fatherId") String fatherId,
                            @FormParam("streamName") String streamName,
                            @FormParam("isDefault") String isDefault,
                            @FormParam("streamIp") String streamIp);

    @POST
    @Path("/flv/start")
    @Produces(MediaType.APPLICATION_JSON)
    public String startFlv(@FormParam("fatherId") String fatherId,
                           @FormParam("streamName") String streamName);

    @POST
    @Path("/flv/stop")
    @Produces(MediaType.APPLICATION_JSON)
    public String stopFlv(@FormParam("fatherId") String fatherId,
                          @FormParam("streamName") String streamName);


    @POST
    @Path("/flv/delete")
    @Produces(MediaType.APPLICATION_JSON)
    public String deleteFlv(@FormParam("fatherId") String fatherId,
                            @FormParam("streamName") String streamName);


    @POST
    @Path("/flv/restart")
    @Produces(MediaType.APPLICATION_JSON)
    public String restartFlv(@FormParam("fatherId") String fatherId,
                             @FormParam("streamName") String streamName,
                             @FormParam("internalIp") String internalIp,
                             @FormParam("streamIp") String streamIp);

    @POST
    @Path("/ts/start")
    @Produces(MediaType.APPLICATION_JSON)
    public String startTs(@FormParam("fatherId") String fatherId,
                          @FormParam("streamName") String streamName);

    @POST
    @Path("/ts/stop")
    @Produces(MediaType.APPLICATION_JSON)
    public String stopTs(@FormParam("fatherId") String fatherId,
                         @FormParam("streamName") String streamName);

    @POST
    @Path("/ts/delete")
    @Produces(MediaType.APPLICATION_JSON)
    public String deleteTs(@FormParam("fatherId") String fatherId,
                           @FormParam("streamName") String streamName);

    @POST
    @Path("/ts/restart")
    @Produces(MediaType.APPLICATION_JSON)
    public String restartTs(@FormParam("fatherId") String fatherId,
                            @FormParam("streamName") String streamName,
                            @FormParam("internalIp") String internalIp,
                            @FormParam("streamIp") String streamIp);

    // 频道流管理DOLBY
    @POST
    @Path("/dolby/create")
    @Produces(MediaType.APPLICATION_JSON)
    public String createDolby(@FormParam("fatherId") String fatherId,
                              @FormParam("streamName") String streamName);

    @POST
    @Path("/dolby/start")
    @Produces(MediaType.APPLICATION_JSON)
    public String startDolby(@FormParam("fatherId") String fatherId,
                             @FormParam("streamName") String streamName);

    @POST
    @Path("/dolby/stop")
    @Produces(MediaType.APPLICATION_JSON)
    public String stopDolby(@FormParam("fatherId") String fatherId,
                            @FormParam("streamName") String streamName);

    @POST
    @Path("/dolby/delete")
    @Produces(MediaType.APPLICATION_JSON)
    public String deleteDolby(@FormParam("fatherId") String fatherId,
                              @FormParam("streamName") String streamName);


    @POST
    @Path("/dolby/restart")
    @Produces(MediaType.APPLICATION_JSON)
    public String restartDolby(@FormParam("fatherId") String fatherId,
                               @FormParam("streamName") String streamName);

    // 获取频道配置列表

    @GET
    @Path("/configs")
    @Produces(MediaType.APPLICATION_JSON)
    public String getConfigs(@QueryParam("type") String type);

    // lego权限

    @GET
    @Path("/permission")
    @Produces(MediaType.APPLICATION_JSON)
    public String permission(@QueryParam("uri") String uri);

    // 请求转发

    @POST
    @Path("/redirect")
    @Produces(MediaType.APPLICATION_JSON)
    public String redirectRequest(@FormParam("request") String request);

    @POST
    @Path("/redirect/passport")
    @Produces(MediaType.APPLICATION_JSON)
    public String passportRequest(@FormParam("request") String request);

    // 统计投递
    @GET
    @Path("/st")
    @Produces(MediaType.APPLICATION_JSON)
    public String statistic();



    // 获取投递数据
    @GET
    @Path("/sd")
    @Produces(MediaType.APPLICATION_JSON)
    public String getStatistic();

    //获取功能点使用统计数据

    @POST
    @Path("/statisticOcr/list")
    @Produces(MediaType.APPLICATION_JSON)
    public String statisticOcrList(@FormParam("startDate") String startDate,
                                   @FormParam("endDate") String endDate,
                                   @FormParam("pageNo") Integer pageNo,
                                   @FormParam("pageSize") Integer pageSize,
                                   @FormParam("channelId") String channelId,
                                   @FormParam("categoryName") String categoryName,
                                   @FormParam("user") String user);

    //获取长视频智能分析统计数据

    @POST
    @Path("/statisticSty2/list")
    @Produces(MediaType.APPLICATION_JSON)
    public String statisticSty2List(@FormParam("startDate") String startDate,
                                    @FormParam("endDate") String endDate,
                                    @FormParam("pageNo") Integer pageNo,
                                    @FormParam("pageSize") Integer pageSize,
                                    @FormParam("channelId") String channelId,
                                    @FormParam("channelName") String channelName,
                                    @FormParam("programName") String programName,
                                    @FormParam("albumName") String albumName,
                                    @FormParam("categoryName") String categoryName,
                                    @FormParam("user") String user);

    //获取长视频智能分析统计分析数据
    @POST
    @Path("/statisticSty2Percent/list")
    @Produces(MediaType.APPLICATION_JSON)
    public String statisticSty2PercentList(@FormParam("startDate") String startDate,
                                           @FormParam("endDate") String endDate,
                                           @FormParam("channelName") String channelName,
                                           @FormParam("albumName") String albumName,
                                           @FormParam("categoryName") String categoryName);
    //suggest channel info for live resource
    @POST
    @Path("/suggest/channel")
    @Produces(MediaType.APPLICATION_JSON)
    public String suggestChannelInfo(@FormParam("channelQipuId") String channelQipuId,
                                     @FormParam("channelName") String channelName,
                                     @FormParam("liveType") String liveType) ;
    // 长视频智能分析suggest入口
    @POST
    @Path("/suggest/statisticSty2")
    @Produces(MediaType.APPLICATION_JSON)
    public String suggestStatisticSty2(@FormParam("field") String field, @FormParam("word") String word);


    @POST
    @Path("/newsDetails/list")
    @Produces(MediaType.APPLICATION_JSON)
    public String newsDetailsList(@FormParam("pageNo") Integer pageNo,
                                  @FormParam("pageSize") Integer pageSize,
                                  @FormParam("newsName") String newsName,
                                  @FormParam("channelName") String channelName,
                                  @FormParam("serverRegion") String serverRegion,
                                  @FormParam("serverIp") String serverIp,
                                  @FormParam("startDate") String startDate,
                                  @FormParam("endDate") String endDate);

    @POST
    @Path("/newsDetails/add")
    public String newsDetailsAdd(String dataString);


    @POST
    @Path("/newsDetails/st")
    @Produces(MediaType.APPLICATION_JSON)
    public String statisticNewsDetailsList(@FormParam("pageNo") Integer pageNo,
                                           @FormParam("pageSize") Integer pageSize,
                                           @FormParam("newsName") String newsName,
                                           @FormParam("channelName") String channelName,
                                           @FormParam("serverRegion") String serverRegion,
                                           @FormParam("serverIp") String serverIp,
                                           @FormParam("startDate") String startDate,
                                           @FormParam("endDate") String endDate);

    @GET
    @Path("/snapshot/call")
    @Produces(MediaType.APPLICATION_JSON)
    public String snapshotCall(@QueryParam("taskid") String taskid, @QueryParam("snapshot") String snapshot,
                               @QueryParam("errcode") String errcode, @QueryParam("errmsg") String errmsg);

    @POST
    @Path("/advert/modify")
    @Produces(MediaType.APPLICATION_JSON)
    public String modifyAdvert(@FormParam("id") Long programId, @FormParam("enable") Integer enable);

    @POST
    @Path("/suggest/dubistreamName")
    @Produces(MediaType.APPLICATION_JSON)
    public String getDuBiStreamNameSuggest(@FormParam("streamName") String streamName,
                                           @FormParam("encodeType") int encodeType);

    @POST
    @Path("/suggest/h265streamName")
    @Produces(MediaType.APPLICATION_JSON)
    public String geth265StreamNameSuggest(@FormParam("streamName") String streamName);

    @POST
    @Path("/newts/create")
    @Produces(MediaType.APPLICATION_JSON)
    public String createNewTs(@FormParam("fatherId") String fatherId,
                              @FormParam("streamName") String streamName);
    @POST
    @Path("/newts/start")
    @Produces(MediaType.APPLICATION_JSON)
    public String startNewTs(@FormParam("fatherId") String fatherId,
                             @FormParam("streamName") String streamName);

    @POST
    @Path("/newts/stop")
    @Produces(MediaType.APPLICATION_JSON)
    public String stopNewTs(@FormParam("fatherId") String fatherId,
                            @FormParam("streamName") String streamName);

    @POST
    @Path("/newts/delete")
    @Produces(MediaType.APPLICATION_JSON)
    public String deleteNewTs(@FormParam("fatherId") String fatherId,
                              @FormParam("streamName") String streamName);

    @POST
    @Path("/newts/restart")
    @Produces(MediaType.APPLICATION_JSON)
    public String restartNewTs(@FormParam("fatherId") String fatherId,
                               @FormParam("streamName") String streamName);



    @POST
    @Path("/configs/add")
    @Produces(MediaType.APPLICATION_JSON)
    public String addConfig(@FormParam("data") String data);

    @POST
    @Path("/configs/edit")
    @Produces(MediaType.APPLICATION_JSON)
    public String editConfig(@FormParam("data") String data);

    @GET
    @Path("/configs/query")
    @Produces(MediaType.APPLICATION_JSON)
    public String queryConfigs(@QueryParam("type") String type,
                               @QueryParam("status") String status,
                               @QueryParam("descr") String descr);


    @POST
    @Path("/notify/alertPlatform")
    @Produces(MediaType.APPLICATION_JSON)
   //liduoduo_sx,yangzhenkun
    public String sendNotify(@FormParam("data") String data);

//    @POST
//    @Path("/version/check")
//    @Produces(MediaType.APPLICATION_JSON)
//    //liduoduo_sx,yangzhenkun
//    public String versionCheck(@FormParam("data") String data);
}


